import React, { PureComponent } from 'react'
import { connect } from "react-redux"
import { Redirect } from 'react-router-dom';

class Writer extends PureComponent {
    render() {
        const { login } = this.props;
        if (login) {
            return (
                <div>写文章</div>
            )
        } else {
            return (<Redirect to="/login"></Redirect>)
        }
    }
}
const mapState = state => ({
    login: state.getIn(["login", "login"])
})

// const mapMethods = (dispatch) => {
// }

export default connect(mapState, null)(Writer)
